<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Command to create an order detail
	*/
	class CommandCreateOrderDetail extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($orderDetail) {
			$this -> orderDetail = $orderDetail;
		}
		
		/*
		* Method to execute to create an order detail
		*/
		public function execute() {
			$GLOBALS['debug'] -> log($this -> orderDetail, "Order detail");
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$ibdad = $daoFactory -> getMySqlOrderDetailAccessDao();
			$orderDetailCreation = $ibdad -> createOrderDetail($this -> orderDetail);
			
			$this -> result = $orderDetailCreation;
		}
	}
?>